package com.atguigu.multiReading;

import java.util.concurrent.Semaphore;

public class demo18 {
    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore=new Semaphore(4);//4个可用资源
        semaphore.acquire();//这是P操作，申请资源，计数器减一
        semaphore.release();//V操作，释放资源
    }
}
